#ifndef MESSAGEEDITAREA_H
#define MESSAGEEDITAREA_H

#include <QWidget>
#include <QPushButton>
#include <QPlainTextEdit>
#include <QScrollBar>
#include "./model/datacenter.h"
#include "toast.h"
#include "mainwidget.h"
#include "soundrecorder.h"

/**********************************************************************************************
 * 右边窗口中的 消息编辑区域
 **********************************************************************************************/

class MessageEditArea : public QWidget
{
    Q_OBJECT
public:
    explicit MessageEditArea(QWidget *parent = nullptr);
    void initSingalSlots();

    void sendMessageTextMessage();
    void addSelfMessage(model::MessageType messageType, const QByteArray& content, const QString& extraInfo);
    void addOtherMessage(const model::MessageInfo& message);
    void clickSendImageMessage();
    void clickSendFileMessage();
    void pressSendSpeechMessage();
    void releaseSendSpeechMessage();
    void sendSpeechMessage(const QString& path);
private:
    QPushButton* sendImageBtn;
    QPushButton* sendFileBtn;
    QPushButton* sendSpeechBtn;
    QPushButton* showHistoryBtn;
    QPlainTextEdit* textEdit;
    QPushButton* sendTextBtn;
    QLabel* tipLabel;
signals:
};

#endif // MESSAGEEDITAREA_H
